package Day2025_03_28;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Demo04 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1 = in.nextLine();
        String s2 = in.nextLine();
        StringBuffer ret = new StringBuffer();
        Set<Character> hash = new HashSet<>();
        for (int i = 0; i < s2.length(); i++) hash.add(s2.charAt(i));
        for (int i = 0; i < s1.length(); i++) {
            if (!hash.contains(s1.charAt(i))) ret.append(s1.charAt(i));
        }
        System.out.println(ret.toString());
    }
}
